-- background: 4755 from stack: in -- bmap block id: 3717 -- flags: 0000 -- background id: 0 -- name: page ----- HyperTalk script ----- on openCard updateBookmarks (the number of this card) send showBookmarks send showFootnotes pass openCard end openCard on showBookmarks global bookmark1 global bookmark2 get the id of this card if it is bookmark1 or it is bookmark2 then show background button "mark" else hide background button "mark" end if end showBookmarks on showFootnotes get field "footnote1" if it is not "" then show field "footnote1" else hide field "footnote1" end if get field "footnote2" if it is not "" then show field "footnote2" else hide field "footnote2" end if end showFootnotes on arrowKey choice put false into dontScroll if visible of background button "Done Changes" is true then beep put true into dontScroll end if if (the name of this card is the name of card "index") or (the name of this card is the name of card "contents") then if visible of card button "Done Changes" is true then beep put true into dontScroll end if end if if dontScroll is false then if choice is "left" then visual scroll right else visual scroll left end if pass arrowKey end if end arrowKey on updatePageNumbers set cursor to watch put the number of card "contents" into presentCard repeat for the number of cards in this background put presentCard into field "page no" of card presentCard updateFootnotes presentCard add 1 to presentCard end repeat end updatePageNumbers on updateFootnotes presentCard global deletedCard get line 1 of field "topic" of card presentCard put it into field "footnote1" of card presentCard if it is not "" then get line 1 of field "card id" of card presentCard if it is not "" then if it is word 3 of deletedCard then put "" into line 1 of field "card id" of card presentCard else get the number of card id it put " - p" & it after field "footnote1" of card presentCard end if end if end if get line 2 of field "topic" of card presentCard put it into field "footnote2" of card presentCard if it is not "" then get line 2 of field "card id" of card presentCard if it is not "" then if it is word 3 of deletedCard then put "" into line 2 of field "card id" of card presentCard else get the number of card id it put " - p" & it after field "footnote2" of card presentCard end if end if end if end updateFootnotes on updateBookmarks presentCard global deletedCard global bookmark1 global bookmark2 if bookmark1 is not 0 then if bookmark1 is deletedCard then put 0 into bookmark1 hide background button "bookmark1" hide field "bookmark1" put "" into field "bookmark1" of card presentCard else get number of bookmark1 put "p" & it into field "bookmark1" of card presentCard end if else put "" into field "bookmark1" of card presentCard end if if bookmark2 is not 0 then if bookmark2 is deletedCard then put 0 into bookmark2 hide background button "bookmark2" hide field "bookmark2" put "" into field "bookmark2" of card presentCard else get number of bookmark2 put "p" & it into field "bookmark2" of card presentCard end if else put "" into field "bookmark2" of card presentCard end if end updateBookmarks on idle global cardJustPasted global cardJustDeleted global deletedCard global stackJustPrinted if stackJustPrinted then put false into stackJustPrinted send showFootnotes pop card else if cardJustDeleted then put false into cardJustDeleted updateBookmarks (the number of this card) send showBookmarks send showFootnotes else if cardJustPasted then put false into cardJustPasted set lockScreen to true push card go card "contents" get the id of this background pop card set lockScreen to false if it is not the id of this background then -- i.e. this is not a true "page" card answer "Background has changed; delete this card!" with "OK" else if the id of this card is deletedCard then put "" into deletedCard end if end if end if end if end if pass idle end idle on openBackground global xrefdepth if xrefdepth is 0 then hide background button "return" end if end openBackground -- part 1 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=424 top=314 right=337 bottom=453 -- title width / last selected line: 0 -- icon id / first selected line: 1014 / 1014 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ----- HyperTalk script ----- on mouseDown global alreadyPaged put false into alreadyPaged pass mouseDown end mouseDown on mouseStillDown global alreadyPaged wait 10 visual effect scroll right put true into alreadyPaged go to previous card end mouseStillDown on mouseUp global alreadyPaged if alreadyPaged is false then visual effect scroll right go to previous card end if end mouseUp -- part 2 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=480 top=314 right=337 bottom=508 -- title width / last selected line: 0 -- icon id / first selected line: 1013 / 1013 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: ----- HyperTalk script ----- on mouseDown global alreadyPaged put false into alreadyPaged pass mouseDown end mouseDown on mouseStillDown global alreadyPaged wait 10 visual effect scroll left put true into alreadyPaged go to next card end mouseStillDown on mouseUp global alreadyPaged if alreadyPaged is false then visual effect scroll left go to next card end if end mouseUp -- part 3 (button) -- low flags: 80 -- high flags: 0000 -- rect: left=400 top=316 right=339 bottom=427 -- title width / last selected line: 0 -- icon id / first selected line: 1012 / 1012 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: return ----- HyperTalk script ----- on mouseUp global xrefdepth subtract 1 from xrefdepth if xrefdepth = 0 then hide background button "return" end if visual effect iris close pop card end mouseUp -- part 4 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=14 top=60 right=300 bottom=494 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: text -- part 6 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=14 top=29 right=57 bottom=328 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 18 -- style flags: 0 -- line height: 24 -- part name: heading ----- HyperTalk script ----- on closeField if cardInContents() then put the userLevel into currentLevel set the userLevel to 5 set lockScreen to true doMenu "New Field" put the number of card fields into numFields choose browse tool set the style of card field numFields to shadow put "Updating Table of Contents." & numToChar(13) & "Please wait..." into card field numFields set lockScreen to false send updateContents to card "contents" set lockScreen to true choose field tool click at the loc of card field numFields doMenu "Clear Field" choose browse tool set lockScreen to false set the userLevel to currentLevel end if pass closeField end closeField function cardInContents set the cursor to watch get word 3 of the id of this card put false into inContents repeat with x = 1 to the number of lines in card field "content list" of card "contents" if (line x of card field "content list" of card "contents") is it then put true into inContents end if end repeat return inContents end cardInContents -- part 7 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=461 top=33 right=51 bottom=494 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 65535 -- font id: 2 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: page no -- part 8 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=8 top=311 right=334 bottom=39 -- title width / last selected line: 0 -- icon id / first selected line: 13081 / 13081 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Contents ----- HyperTalk script ----- on mouseUp visual iris close go card "contents" end mouseUp -- part 9 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=453 top=313 right=338 bottom=480 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: book ----- HyperTalk script ----- on mouseUp -- Actually, to be really consistent we should update the bookmarks -- of ALL pages here, so that when you Print Report they are all -- correct. However, this would slow things down for the reader. global bookmark1 global bookmark2 get the id of this card if bookmark1 = 0 then put it into bookmark1 updateBookmarks (the number of this card) show background button "bookmark1" show field "bookmark1" send showBookmarks else if bookmark2 = 0 then put it into bookmark2 updateBookmarks (the number of this card) show background button "bookmark2" show field "bookmark2" send showBookmarks else answer "Out of bookmarks!" with "OK" end if end if end mouseUp -- part 11 (button) -- low flags: 80 -- high flags: 0000 -- rect: left=451 top=313 right=338 bottom=476 -- title width / last selected line: 0 -- icon id / first selected line: 18951 / 18951 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: mark ----- HyperTalk script ----- on mouseUp global bookmark1 global bookmark2 get the id of this card if it is bookmark1 then put 0 into bookmark1 hide background button "bookmark1" hide field "bookmark1" end if if it is bookmark2 then put 0 into bookmark2 hide background button "bookmark2" hide field "bookmark2" end if updateBookmarks (the number of this card) send showBookmarks end mouseUp -- part 17 (field) -- low flags: 01 -- high flags: 0002 -- rect: left=367 top=326 right=340 bottom=394 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 4 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: bookmark1 -- part 18 (field) -- low flags: 81 -- high flags: 0002 -- rect: left=337 top=326 right=340 bottom=364 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 4 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: bookmark2 -- part 13 (button) -- low flags: 80 -- high flags: 0000 -- rect: left=336 top=300 right=339 bottom=362 -- title width / last selected line: 0 -- icon id / first selected line: 6179 / 6179 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: bookmark2 ----- HyperTalk script ----- on mouseUp global bookmark1 global bookmark2 if the id of this card is not bookmark2 then if (the name of this card is not the name of card "contents") and (the id of this card is not bookmark1) then global xrefdepth add 1 to xrefdepth push card show background button "return" end if visual effect iris open go bookmark2 end if end mouseUp -- part 12 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=366 top=300 right=339 bottom=392 -- title width / last selected line: 0 -- icon id / first selected line: 6179 / 6179 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: bookmark1 ----- HyperTalk script ----- on mouseUp global bookmark1 global bookmark2 if the id of this card is not bookmark1 then if (the name of this card is not the name of card "contents") and (the id of this card is not bookmark2) then global xrefdepth add 1 to xrefdepth push card show background button "return" end if visual effect iris open go bookmark1 end if end mouseUp -- part 20 (field) -- low flags: 81 -- high flags: 0002 -- rect: left=54 top=309 right=324 bottom=321 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: footnote1 ----- HyperTalk script ----- on mouseUp get line 1 of field "card id" if it is not "" then global xrefdepth add 1 to xrefdepth push card show background button "return" visual iris open get last word of me put "" into first char of it go card it end if end mouseUp -- part 23 (field) -- low flags: 81 -- high flags: 0002 -- rect: left=54 top=325 right=340 bottom=321 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 2 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: footnote2 ----- HyperTalk script ----- on mouseUp get line 2 of field "card id" if it is not "" then global xrefdepth add 1 to xrefdepth push card show background button "return" visual iris open get last word of me put "" into first char of it go card it end if end mouseUp -- part 30 (button) -- low flags: 80 -- high flags: 0000 -- rect: left=1 top=21 right=340 bottom=510 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: beep ----- HyperTalk script ----- on mouseUp beep end mouseUp -- part 26 (button) -- low flags: 80 -- high flags: A003 -- rect: left=367 top=26 right=43 bottom=470 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Done Changes ----- HyperTalk script ----- on mouseUp hide background button "beep" hide background button "Topic" hide background button "Card ID (optional)" hide field "topic" hide field "card id" hide background button "Done Changes" show background button "Add Footnote" updateFootnotes (the number of this card) send showFootnotes end mouseUp -- part 25 (button) -- low flags: 00 -- high flags: A003 -- rect: left=366 top=26 right=43 bottom=467 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Add Footnote ----- HyperTalk script ----- on mouseUp show background button "beep" show background button "Topic" show background button "Card ID (optional)" show field "topic" show field "card id" hide background button "Add Footnote" show background button "Done Changes" end mouseUp -- part 28 (button) -- low flags: 80 -- high flags: 8002 -- rect: left=51 top=111 right=133 bottom=318 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Topic -- part 31 (button) -- low flags: 80 -- high flags: 8002 -- rect: left=317 top=111 right=133 bottom=448 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Card ID (optional) -- part 27 (field) -- low flags: 80 -- high flags: 0002 -- rect: left=51 top=132 right=162 bottom=318 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 4 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: topic -- part 29 (field) -- low flags: 80 -- high flags: 0002 -- rect: left=317 top=132 right=162 bottom=448 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 4 -- text size: 9 -- style flags: 0 -- line height: 12 -- part name: card id -- part 33 (button) -- low flags: 80 -- high flags: A003 -- rect: left=356 top=44 right=61 bottom=477 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Update Page Nos ----- HyperTalk script ----- on mouseUp global deletedCard hide background button "Update Page Nos" put the userLevel into currentLevel set the userLevel to 5 set lockScreen to true doMenu "New Field" put the number of card fields into numFields choose browse tool set the style of card field numFields to shadow put "Updating page numbers." & numToChar(13) & "Please wait..." into card field numFields set lockScreen to false send updatePageNumbers send showFootnotes updateBookmarks (the number of this card) -- Actually, to be really consistent we should update ALL the -- bookmarks here, so that when you Print Report they are all -- correct. However, bookmarks are not that important. send showBookmarks send updateContents to card "contents" send updateIndex to card "index" set lockScreen to true choose field tool click at the loc of card field numFields doMenu "Clear Field" choose browse tool set lockScreen to false set the userLevel to currentLevel put "" into deletedCard beep end mouseUp